///*
// *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
// *
// *  Redistribution and use in source and binary forms, with or without
// *  modification, are permitted provided that the following conditions are met:
// *
// *  Redistributions of source code must retain the above copyright notice,
// *  this list of conditions and the following disclaimer.
// *  Redistributions in binary form must reproduce the above copyright
// *  notice, this list of conditions and the following disclaimer in the
// *  documentation and/or other materials provided with the distribution.
// *  Neither the name of the dreamlu.net developer nor the names of its
// *  contributors may be used to endorse or promote products derived from
// *  this software without specific prior written permission.
// *  Author: Chill 庄骞 (smallchill@163.com)
// */
//package com.plian.system.controller.fr.vehicle;
//
//import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
//import com.baomidou.mybatisplus.core.metadata.IPage;
//import com.plian.Tools.Func;
//import com.plian.Tools.StringPool;
//import com.plian.Tools.base.BaseController;
//import com.plian.Tools.pagedata.PageData;
//import com.plian.system.config.Resubmit;
//import com.plian.system.dto.fr.vehicle.VehicleEliminateDTO;
//import com.plian.system.entity.fr.vehicle.VehicleEliminate;
//import com.plian.system.model.CommonCode;
//import com.plian.system.model.ListResult;
//import com.plian.system.model.ObjResult;
//import com.plian.system.model.R;
//import com.plian.system.mybatis.search.SearchEntity;
//import com.plian.system.mybatis.search.SearchParamEntiy;
//import com.plian.system.mybatis.search.TokenSearch;
//import com.plian.system.mybatis.support.Condition;
//import com.plian.system.mybatis.support.Query;
//import com.plian.system.service.fr.vehicle.IVehicleEliminateService;
//import com.plian.system.vo.fr.vehicle.VehicleEliminateVO;
//import com.plian.system.vo.report.ReportReturnVO;
//import com.plian.system.wrapper.fr.veihicle.VehicleEliminateWrapper;
//import io.swagger.annotations.Api;
//import io.swagger.annotations.ApiOperation;
//import lombok.AllArgsConstructor;
//import lombok.extern.slf4j.Slf4j;
//import org.apache.commons.lang3.StringUtils;
//import org.springframework.web.bind.annotation.PostMapping;
//import org.springframework.web.bind.annotation.RequestBody;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RestController;
//
//import javax.validation.Valid;
//import java.util.List;
//import java.util.Optional;
//
///**
// * 车辆淘汰管理 控制器
// *
// * @author jianglei
// * @since 2019-09-30
// */
//@Slf4j
//@RestController
//@RequestMapping("api/vehicleeliminate")
//@Api(value = "车辆淘汰管理", tags = "车辆淘汰管理 接口")
//@AllArgsConstructor
//public class VehicleEliminateController extends BaseController {
//
//
//	private final IVehicleEliminateService vehicleEliminateService;
//
//	private final VehicleEliminateWrapper vehicleEliminateWrapper;
//
//    /**
//    * 详情
//    */
//	@PostMapping("/detail")
//	@ApiOperation(value = "详情", notes = "传入vehicleEliminate")
//	public R<VehicleEliminateVO> detail(@Valid @RequestBody VehicleEliminate vehicleEliminate) {
//		VehicleEliminate detail = vehicleEliminateService.getOne(Condition.getQueryWrapper(vehicleEliminate));
//		return R.data(vehicleEliminateWrapper.entityToVO(detail));
//	}
//
//	/**
//	* 分页 车辆淘汰管理
//	*/
//	@PostMapping("/list")
//	@ApiOperation(value = "分页", notes = "传入vehicleEliminate")
//	public ListResult<VehicleEliminateVO> list(@RequestBody Query query) {
//
//		List<SearchEntity> entityList = query.getSearch();
//
//		if (query.getAscs()==null&&query.getDescs()==null){
//			query.setDescs("create_time");
//		}
//        QueryWrapper<VehicleEliminate> queryWrapper = SearchParamEntiy.getQueryWrapper(Condition.getQueryWrapper(new VehicleEliminate()), entityList);
//		TokenSearch<VehicleEliminate> tokenSearch = new TokenSearch<>();
//		tokenSearch.addTokenQuery(queryWrapper, query);
//		IPage<VehicleEliminate> pages = vehicleEliminateService.page(Condition.getPage(query), queryWrapper);
//		ListResult<VehicleEliminateVO> listResult = new ListResult<>(CommonCode.SUCCESS);
//		listResult.setList(vehicleEliminateWrapper.entityToVO(pages.getRecords()));
//		listResult.setTotal(Long.valueOf(pages.getTotal()).intValue());
//		return listResult;
//	}
//
//	/**
//	* 新增或修改 车辆淘汰管理
//	*/
//	@PostMapping("/submit")
//	@Resubmit(delaySeconds = 0)
//	@ApiOperation(value = "新增或修改", notes = "传入vehicleEliminate")
//	public R submit(@Valid @RequestBody VehicleEliminate vehicleEliminate) {
//		if (!(Optional.ofNullable(vehicleEliminate).isPresent() && Optional.ofNullable(vehicleEliminate.getStatus()).isPresent()
//				&& vehicleEliminate.getStatus() == -1)) {
//			String result = vehicleEliminateService.checkSubmit(vehicleEliminate);
//			if (Optional.ofNullable(result).isPresent()) {
//				return R.fail(result);
//			}
//		}
//		return R.status(vehicleEliminateService.submit(vehicleEliminate, 1));
//	}
//
//	/**
//	* 删除 车辆淘汰管理
//	*/
//	@PostMapping("/remove")
//	@ApiOperation(value = "逻辑删除", notes = "传入ids")
//	public R remove(@RequestBody PageData pd) {
//		List<String> ids = (List<String>)pd.get("ids");
//		return R.status(vehicleEliminateService.deleteLogic(Func.toLongList(StringUtils.join(ids, StringPool.COMMA))));
//	}
//
//	/**
//	 * 变更 车辆淘汰管理
//	 */
//	@PostMapping("/change")
//	@ApiOperation(value = "变更", notes = "传入vehicleEliminate")
//	public ObjResult change(@Valid @RequestBody VehicleEliminate vehicleEliminate) {
//		return vehicleEliminateService.change(vehicleEliminate);
//	}
//
//	/**
//	 * 报表 车辆淘汰管理
//	 */
//	@PostMapping("/report")
//	@ApiOperation(value = "报表", notes = "传入vehicleEliminateDTO")
//	public R<ReportReturnVO> report(@Valid @RequestBody VehicleEliminateDTO vehicleEliminateDTO) {
//		return R.data(vehicleEliminateService.report(vehicleEliminateDTO));
//	}
//
//}
